onload = () => {
    loadCSS("../css/fontello.css", "bootstrap5-icon");
    loadCSS("../css/bootstrap5.min.css", "bootstrap5");
    loadCSS("../css/common.css", "common");
    loadScript("../js/bootstrap5.bundle.min.js").then(() => loadScript("../js/crud.js")).then(() => {
        let templateOperator = new Crud({
            module: "template",
            hasCheckbox: true,
            iterators: [],
            opsButton: ["new"],
            search: [{"caption": "Name", "type": "text", "name": "name", class: "col-3"}],
            listField: [{"caption": "ID", "field": "templateId"}, {"caption": "Name", "field": "name"}],
            editFields: [
                {"name": "name", "placeHolder": "name", "required": "required"},
                {"name": "description", "placeHolder": "description", "required": "required"},
                {"name": "content", "placeHolder": "content",class:"col-12 h-12",type:"textarea", "required": "required"}
            ]
        });
        templateOperator.init()
    }).catch((err) => console.error(err));
}
